package com.qk.management.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qk.dto.course.CourseDTO;
import com.qk.entity.Course;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface CourseMapper {
    List<Course> selectByPage(CourseDTO courseDto);

    void insert(Course course);

    @Delete("delete from course where id = #{id}")
    void deleteById(Integer id);

    void update(Course course);

    @Select("select * from course where id = #{id}")
    Course getById(Integer id);

    @Select("select * from course")
    List<Course> getAllCourses();

    @Select("select * from course where subject= #{subject}")
    List<Course> getBySubject(String subject);
}
